<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
//软删除类
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Testing\Constraints\SoftDeletedInDatabase;
//按钮
use App\Models\Traits\Btn;
class User extends \Illuminate\Foundation\Auth\User
{
    //调用定义好的trait类 和继承效果一样
    use SoftDeletes,Btn;
    //软删除标识字段
    protected $dates = ['deleted_at'];

    //设置添加的字段
    //拒绝不添加的字段
    protected $guarded = [] ;

    //隐藏字段
    protected $hidden=['password'];
    //角色 属于
    public function role()
    {
        return $this->belongsTo(Role::class,'role_id');
    }

}
